<?xml version="1.0" encoding="ISO-8859-1"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                template="template.xhtml">
    <ui:define name="body">
        <h:form>   
            <p:panel id="editDialog" header="Mail edit">
                <p:messages/>
                <h:panelGrid columns="3">
                    <h:outputLabel value="Sender:" for="editSender"/>
                    <p:inputText id="editSender" readonly="true" value="#{mailListActions.editMail.sender}"/>
                    <h:outputText value=""/>

                    <h:outputLabel value="Receiver:" for="editReceiver"/>
                    <p:inputText id="editReceiver" required="true" value="#{mailListActions.editMail.receiver}"/>
                    <p:message for="editReceiver"/>

                    <h:outputLabel value="Subject:" for="editSubject"/>
                    <p:inputText id="editSubject" required="true" value="#{mailListActions.editMail.subject}"/>
                    <p:message for="editSubject"/>

                </h:panelGrid>

                <ui:include src="mail_attachment.xhtml">
                    <ui:param name="attachmentContainer" value="#{mailListActions.attachmentContainer}"/>
                    <ui:param name="allowAdding" value="true"/>
                </ui:include>

                <p:editor id="editContent" required="true" value="#{mailListActions.editMail.content}"/>
                <p:message for="editContent"/>                    

                <f:facet name="footer">
                    <p:commandButton value="Cancel" ajax="false" immediate="true"
                                     action="mail_list.xhtml?faces-redirect=true"/>
                    <p:commandButton value="Send" ajax="false" actionListener="#{mailListActions.send()}" 
                                     action="mail_list.xhtml?faces-redirect=true"/>
                </f:facet>
            </p:panel>
        </h:form>
    </ui:define>
</ui:composition>